package org.stuy.jumpgame;

import javafx.application.Application;
import static javafx.application.Application.launch;
import javafx.fxml.FXMLLoader;
import javafx.scene.Group;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.stage.Stage;


public class MainApp extends Application {

    
    
    private static int[][] content;
    private static int xMax= 320;
    private static int yMax= 200;
    
    
    @Override
    public void start(Stage stage) throws Exception {
        Parent root = FXMLLoader.load(getClass().getResource("/fxml/Scene.fxml"));
        
        Scene scene = new Scene(root);
        Image image = new Image("http://docs.oracle.com/javafx/"  
        + "javafx/images/javafx-documentation.png");  
        ImageView imageView = new ImageView();  
        imageView.setImage(image);  
        
        
        scene.getStylesheets().add("/styles/Styles.css");
        
        stage.setTitle("jump game, having fun!");
        stage.setScene(scene);
        stage.show();
    }

    /**
     * The main() method is ignored in correctly deployed JavaFX application.
     * main() serves only as fallback in case the application can not be
     * launched through deployment artifacts, e.g., in IDEs with limited FX
     * support. NetBeans ignores main().
     *
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        initData();
        launch(args);
    }
    public static void initData(){
        
     
        content = new int[xMax][yMax];
        
        for(int x=0;x<320;x++){
            for(int y=0;y<200;y++){
                if(x%5==0)
                    content[x][y]=1;
                else
                    content[x][y]=0;
            }
        }
    }
    
    public void draw(){
       StringBuffer sb = new StringBuffer();
       for(int x=0;x<xMax;x++){
           for(int y=0;y<yMax;y++){
               if(content[x][y]==1){
                  
               }else{
               }
           }
           sb.append("\n\r");
       }
    }
    public void repaint(int x,int y){
        content[x][y]=content[x][y]==1?0:1;
    }
}
